


import java.io.*;
import java.net.Socket;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import external.*;

public class SocketListener implements Runnable {
	private Socket socket;
	private Object data;
	private Boolean dataAreReady;
	public SocketListener(Socket socket, Boolean data)
	{
		this.socket = socket;
		this.data = data;
	}
	
	public void run()
	{
			try {
				InputStream is = socket.getInputStream();
				ObjectInputStream ois = new ObjectInputStream(is);
				Message message = (Message)ois.readObject();
				if(message.type==Message.Type.StartGame) NET.ToggleGameStart();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}  catch (ClassNotFoundException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

	}
}
